import './style.css'
import javascriptLogo from './javascript.svg'
import viteLogo from '/electron-vite.svg'
import { setupCounter } from './counter.js'

document.querySelector('#app').innerHTML = `
  <div>
    <a href="https://electron-vite.github.io" target="_blank">
      <img src="${viteLogo}" class="logo" alt="Vite logo" />
    </a>
    <a href="https://js.org/index.html" target="_blank">
      <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
    </a>
    <h1>Vite + JavaScript</h1>
    <div class="card">
      <button id="counter" type="button">--</button>
    </div>
    <p class="read-the-docs">
      Click on the Vite and JavaScript logos to learn more
    </p>
  </div>
`

setupCounter(document.querySelector('#counter'))

// Use contextBridge
window.ipcRenderer.on('main-process-message', (_event, message) => {
  console.log(message)
})
